//
//  PriorityColorTransformer.m
//  Task Views
//
//  Created by Chris Karr on 10/6/09.
//  Copyright 2009 Audacious Software. All rights reserved.
//

#import "PriorityColorTransformer.h"


@implementation PriorityColorTransformer

+ (Class) transformedValueClass 
{
	return [NSColor class]; 
}

+ (BOOL)allowsReverseTransformation 
{
	return NO;
}

- (id)transformedValue:(id)item 
{
	if (item == nil)
		return [NSColor blackColor];
	else if ([item isEqual:@"Very High"])
		return [NSColor redColor];
	else if ([item isEqual:@"High"])
		return [NSColor orangeColor];
	else if ([item isEqual:@"Low"])
		return [NSColor blueColor];
	else if ([item isEqual:@"Very Low"])
		return [NSColor colorWithCalibratedRed:0 green:0.5 blue:0 alpha:1.0];
	
	return [NSColor blackColor];
}

@end
